#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

int main() {
    string S;
    cin >> S;
    string revS(S.rbegin(), S.rend());
    string T = S + "#" + revS;
    
    int n = T.size();
    vector<int> pi(n, 0);
    for (int i = 1; i < n; ++i) {
        int j = pi[i - 1];
        while (j > 0 && T[i] != T[j]) {
            j = pi[j - 1];
        }
        if (T[i] == T[j]) {
            j++;
        }
        pi[i] = j;
    }
    
    int l = pi.back();
    string prepend = revS.substr(0, S.size() - l);
    cout << prepend + S << endl;
    
    return 0;
}
